<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            width: 100%;
            max-width: 400px;
            padding: 30px;
        }
        
        h1 {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
            font-weight: 600;
        }
        
        form {
            width: 100%;
        }
        
        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 12px 15px;
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 16px;
            transition: border-color 0.3s;
        }
        
        input[type="text"]:focus,
        input[type="password"]:focus {
            border-color: #2575fc;
            outline: none;
            box-shadow: 0 0 0 2px rgba(37, 117, 252, 0.2);
        }
        
        input[type="submit"] {
            width: 100%;
            padding: 12px;
            background: linear-gradient(to right, #6a11cb, #2575fc);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        input[type="submit"]:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
        }
        
        input[type="submit"]:active {
            transform: translateY(0);
        }
        
        .demo-info {
            margin-top: 20px;
            padding: 15px;
            background-color: #f8f9fa;
            border-radius: 6px;
            font-size: 14px;
            color: #666;
        }
        
        .demo-info h3 {
            margin-bottom: 10px;
            color: #333;
        }
        
        .message {
            text-align: center;
            margin-top: 15px;
            font-size: 14px;
            display: none;
            padding: 10px;
            border-radius: 6px;
        }
        
        .error {
            color: #e74c3c;
            background-color: #ffeaea;
            border: 1px solid #ffcdd2;
        }
        
        .success {
            color: #2ecc71;
            background-color: #eaffea;
            border: 1px solid #c8e6c9;
        }
    </style>
</head>
<body>
     <div class="container">
        <h1>用户登录</h1>
        <form id="loginForm" method="post">
            <input type="text" name="username" id="username" placeholder="请输入用户名" required><br>
            <input type="password" name="password" id="password" placeholder="请输入密码" required><br>
            <input type="submit" value="登录">
        </form>
        
        <div id="message" class="message"></div>
        
        <div class="demo-info">
            <h3>使用说明</h3>
            <p>输入任意用户名和密码，点击登录即可跳转到成功页面</p>
        </div>
    </div>

    <script>
        // 获取表单和消息元素
        const loginForm = document.getElementById('loginForm');
        const messageDiv = document.getElementById('message');
        
        // 表单提交事件处理
        loginForm.addEventListener('submit', function(event) {
            // 阻止表单默认提交行为
            event.preventDefault();
            
            // 获取用户名和密码
            let username = document.getElementById("username").value;
            let password = document.getElementById("password").value;
            
            // 显示消息
            messageDiv.textContent = "登录成功！正在跳转...";
            messageDiv.className = "message success";
            messageDiv.style.display = "block";
            
            // 延迟跳转，让用户看到成功消息
            setTimeout(function() {
                window.location.href = "loginSuccess.html";
            }, 1500);
        });
    </script>
</body>
</html>